/* eslint-disable no-use-before-define */
/* eslint-disable react/react-in-jsx-scope */
import React, { Component } from 'react';
import {
    View,
    Text,
    Platform,
    ProgressViewIOS,
    ProgressBarAndroid,
} from 'react-native';
import config from '../../config';

export default class LoadingScreen extends Component {

    render() {
        const { loadingPercent } = this.props
        return (
            <View style={{ justifyContent: 'center', alignItems: 'center', }}>
                <View style={{ width: '100%', marginTop: Platform.OS == 'android' ? -5 : 0, }}>
                    {Platform.OS == 'android' ?
                        <ProgressBarAndroid
                            color={config.themeColor}
                            indeterminate={false}
                            progress={loadingPercent / 100}
                            styleAttr={'Horizontal'}
                        />
                        : <ProgressViewIOS
                            progress={loadingPercent / 100}
                            progressViewStyle={'bar'}
                        />}
                </View>
                <Text style={{ margin: 15, }}>正在抓取话术文件({loadingPercent}%)...</Text>
            </View>
        )
    }
}